package com.bangdao.app.jetpacktest.jetpack.databinding.bean;

import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;

import com.bangdao.app.jetpacktest.BR;

/**
 * @ProjectName: JetpackTest
 * @ClassName: LoginModel
 * @Description: java类作用描述
 * @Author: luhui
 * @Email: hui.lu@bangdao-tech.com
 * @CreateDate: 2022/6/4 21:03
 * @UpdateUser: luhui
 * @UpdateDate: 2022/6/4 21:03
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public class LoginModel1 extends BaseObservable {
    private String userName;

    @Bindable
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        if(userName != null && !userName.equals(this.userName)){
            this.userName = userName;
            //可以在此处理一些与业务相关的逻辑，例如userName字段
            notifyPropertyChanged(BR.userName);
            //或者 直接使用notifyChange()，那样的话连@Bindable注解都不需要了
//            notifyChange();
        }
    }
}
